﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace UpdateUDMBackService
{
    public class CXError
    {
        public static string NotFound = "notFound";
        public string code { get; set; } = "UnkownError";
        public string message { get; set; } = "不能解析错误返回结果";
        public object[] data { get; set; } = { };

        public static CXError unkownType = new CXError() { code = "UnkownType", message = "不能正确解析返回数据" };
        public static CXError notLogin = new CXError() { code = "NotLogin", message = "用户未登录" };
        public static CXError serverError = new CXError() { code = "ServerError", message = "服务器返回异常" };
        public static CXError success = new CXError() { code = "Ok", message = "成功" };
        public static CXError notFound = new CXError() { code = "notFound", message = "用户未注册" };
        public static CXError unauthorized = new CXError() { code = "unauthorized", message = "登录已过期" };
        public static CXError unkownError(string message = "未知错误")
        {
            return new CXError() { code = "UnkownError", message = message };
        }
    }
}
